<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <form id="myForm" name="myForm">
    <div>
      <label for="username">Enter name:</label>
      <input type="text" id="username" value="zhangsna" name="username">
    </div>
    <div>
      <label for="useracc">Enter account number:</label>
      <input type="text" id="useracc" value="acc" name="useracc">
    </div>
    <div>
      <label for="userfile">Upload file:</label>
      <input type="file" id="userfile" name="userfile">
    </div>
  <input type="submit" value="Submit!">
  </form>
  <script>
    // 定义formData对象收集表单信息
    var myForm = document.getElementById('myForm');
    formData = new FormData(myForm);
    formData.append('a', 100)
    // 获取信息
    console.log(formData.get('username'));
    console.log(formData.get('useracc'));
    console.log(formData.get('a'));
   
   
  </script>
</body>
</html>